﻿<%@ WebHandler Language="C#" Class="list" %>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web.Security;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.IO;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using System.Text;
using System.Data.OracleClient;
using System.Net.Mail;
using System.Net;
using System.Web.Script.Serialization;


public class list : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
    private StringBuilder sb = null;
    public DataSet ds = null;
    public DataTable dt = null;
    private string sqlwhere = "";
    public void ProcessRequest(HttpContext context)
    {
        string type = PageBase.ext_string(context.Request.Params["type"]);
        switch (type)
        {
            //获取底部导航栏信息
            case "get_navbarlist":
                get_navbarlist(context);
                break;
            default:
                //getinfo(context);
                break;
        }
    }
    //获取底部导航栏信息
    public void get_navbarlist(HttpContext context)
    {
        //string customerCode = PageBase.ext_string(context.Request.Params["customerCodes"]);
        string sqllist = @"select xh,footnavbar,icon,navbaraddress,isactive from [t_footNavbar] where ltrim(rtrim(isactive))='Y' order by xh ";
        DataTable dtResult = DBHelper.ExecuteDataTable(sqllist);
        sb = new StringBuilder();
        sb.Append("{\"item\":[");
        for (int i = 0; i < dtResult.Rows.Count; i++)
        {
            sb.Append("{\"xh\":\"" + dtResult.Rows[i]["xh"].ToString() + "\",");
            sb.Append("\"footnavbar\":\"" + dtResult.Rows[i]["footnavbar"].ToString() + "\",");
                            sb.Append("\"icon\":\"" + dtResult.Rows[i]["icon"].ToString() + "\",");
            sb.Append("\"navbaraddress\":\"" + dtResult.Rows[i]["navbaraddress"].ToString() + "\",");
            sb.Append("\"isactive\":\"" + dtResult.Rows[i]["isactive"].ToString() + "\"}");
            if (i < dtResult.Rows.Count - 1)
            {
                sb.Append(",");
            }
        }
        sb.Append("]}");
        context.Response.Write(sb.ToString());
        context.Response.ContentType = "text/json";
        context.Response.End();
    }

    public class GetDate
    {
        public List<main> ArrayObj_main { get; set; }//主表信息
        public List<mx> ArrayObj_mx { get; set; }//明细信息
    }
    public class main
    {
        //单据编号
        public string id;
        public string ID
        {
            get { return id; }
            set { id = value; }
        }
        //单据编号
        public string docno;
        public string DOCNO
        {
            get { return docno; }
            set { docno = value; }
        }
        //店仓编号
        public string userid;
        public string USERID
        {
            get { return userid; }
            set { userid = value; }
        }
        //店仓编号
        public string customerCode;
        public string CUSTOMERCODE
        {
            get { return customerCode; }
            set { customerCode = value; }
        }
        //收货人姓名
        public string shr;
        public string SHR
        {
            get { return shr; }
            set { shr = value; }
        }
        //手机号
        public string phone;
        public string PHONE
        {
            get { return phone; }
            set { phone = value; }
        }
        //企微手机号
        public string mobile;
        public string MOBILE
        {
            get { return mobile; }
            set { mobile = value; }
        }
        //收货人地址
        public string address;
        public string ADDRESS
        {
            get { return address; }
            set { address = value; }
        }
        //备注
        public string remark;
        public string REMARK
        {
            get { return remark; }
            set { remark = value; }
        }


        //快递公司
        public string txt_kdgs;
        public string TXT_KDGS
        {
            get { return txt_kdgs; }
            set { txt_kdgs = value; }
        }
        //快递单号
        public string txt_kddh;
        public string TXT_KDDH
        {
            get { return txt_kddh; }
            set { txt_kddh = value; }
        }
        //发货人
        public string txt_kdfhr;
        public string TXT_KDFHR
        {
            get { return txt_kdfhr; }
            set { txt_kdfhr = value; }
        }
        //发货人联系电话
        public string txt_kdtel;
        public string TXT_KDTEL
        {
            get { return txt_kdtel; }
            set { txt_kdtel = value; }
        }

    }
    //尺码
    public class mx
    {
        //tmid
        public string tmid;
        public string TMID
        {
            get { return tmid; }
            set { tmid = value; }
        }

        //数量
        public int? sl;
        public int? SL
        {
            get { return sl; }
            set { sl = value; }
        }
        //备注
        public string mark;
        public string MARK
        {
            get { return mark; }
            set { mark = value; }
        }

        public string imageurl;
        public string IMAGEURL
        {
            get { return imageurl; }
            set { imageurl = value; }
        }

    }
    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}